<template>
  <div class="f-logo">
      <img class="f-img" :src="imgSrc"/>
      <span class="f-title">{{setting_projectTitle}}</span>
  </div>
</template>
<script>
import {mapGetters} from 'vuex'
import {isExternal} from '@/utils/validate'

export default {
  data () {
    return {}
  },
  computed: {
    ...mapGetters([
      'setting_projectTitle',
      'setting_logoImgSrc'
    ]),
    imgSrc () {
      if (isExternal(this.setting_logoImgSrc)) {
        return this.setting_logoImgSrc
      }
      return require('@/assets/images/' + this.setting_logoImgSrc)
    }
  }
}
</script>
<style scoped>
  .f-logo {
    position: relative;
    width: 100%;
    height: 50px;
    line-height: 50px;
    text-align: center;
    overflow: hidden;
  }

  .f-logo .f-img {
    width: 50px;
    height: 50px;
    vertical-align: middle;
    border-radius: 10px;
  }

  .f-logo .f-title {
    display: inline-block;
    margin: 0;
    font-weight: bold;
    line-height: 50px;
    font-size: 14px;
    font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
    vertical-align: middle;
  }
</style>
